package no.ntnu.idi.lemma;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import no.ntnu.idi.deid.preprocessor.postagger.POSTag;

public class NorkompleksKey {
	
	private POSTag tag;
	private String word;
	
	public NorkompleksKey(String word, POSTag pos) {
		tag = pos;
		this.word = word;
	}

	@Override
	public boolean equals(Object obj) {
	    if(obj instanceof NorkompleksKey){
	        final NorkompleksKey other = (NorkompleksKey) obj;
	        return new EqualsBuilder()
	            .append(tag, other.tag)
	            .append(word, other.word)
	            .isEquals();
	    } else{
	        return false;
	    }
	}

	@Override
	public int hashCode() {	
		return new HashCodeBuilder(13,31)
				.append(tag)
				.append(word)
				.toHashCode();
	}
}
